package com.cabrida.livestar.message;

import java.util.ArrayList;

import android.R.integer;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.cabrida.livestar.R;

/**
 * 消息中心adapter
 * 
 * @author why
 * 
 */
public class MessageLvAdapter extends BaseAdapter {

	private LayoutInflater mInflater;
	private ArrayList<String> data_list = new ArrayList<String>();

	public MessageLvAdapter(Context context) {
		this.mInflater = LayoutInflater.from(context);
	}

	public void setData(ArrayList<String> data) {
		data_list = data;
	}

	@Override
	public int getCount() {
		return data_list.size();
	}

	@Override
	public Object getItem(int arg0) {
		return null;
	}

	@Override
	public long getItemId(int arg0) {
		return arg0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {

		ViewHolder holder = null;
		if (convertView == null) {

			holder = new ViewHolder();

			convertView = mInflater.inflate(
					R.layout.adapter_message_lv_item, null);
			convertView.setTag(holder);

		} else {
			holder = (ViewHolder) convertView.getTag();

		}

		return convertView;
	}

	class ViewHolder {
		private TextView textView_area1;
	}

}
